package com.holly.unit.bpmn.activiti.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.holly.unit.db.api.pojo.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 类描述: 流程业务扩展表
 *
 * @author fxr
 * @version 1.0.0
 * @date 2022/2/22 10:48
 */
@EqualsAndHashCode(callSuper = true)
@TableName("act_z_business")
@Data
public class ActivitiZBusiness extends BaseEntity {

    /**表单路由*/
    @TableField(exist=false)
    private String routeName;
    /**流程名称*/
    @TableField(exist=false)
    private String processName;
    /**id*/
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**delFlag*/
    @TableField(value = "del_flag", fill = FieldFill.INSERT)
    private String delFlag;

    /**流程定义id*/
    @TableField("proc_def_id")
    private String procDefId;
    /**流程实例id*/
    @TableField("proc_inst_id")
    private String procInstId;
    /**结果状态 0未提交默认 1处理中 2通过 3驳回*/
    @TableField("result")
    private Integer result ;
    /**状态 0草稿默认 1处理中 2结束*/
    @TableField("status")
    private Integer status ;
    /**关联表的数据id*/
    @TableField("table_id")
    private String tableId;
    /**申请标题*/
    @TableField("title")
    private String title;
    /**创建用户id*/
    @TableField("user_id")
    private String userId;
    /**提交申请时间*/

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("apply_time")
    private Date applyTime;
    /**历史标记*/
    @TableField("is_history")
    private Boolean isHistory;
    /**数据表名*/
    @TableField("table_name")
    private String tableName;

    /**所属应用id*/
    @TableField("appid")
    private String appid;

    /**1、手动表单，2、表单设计器表单*/
    @TableField("type")
    private Integer type;


    /**分配用户username*/
    @TableField(exist=false)
    private String assignees;
    /*任务优先级 默认0   0普通1重要2紧急*/
    @TableField(exist=false)
    private Integer priority = 0;
    /**当前任务*/
    @TableField(exist=false)
    private String currTaskName;
    /**第一个节点是否为网关*/
    @TableField(exist=false)
    private Boolean firstGateway = false;
    /**是否发送站内消息*/
    @TableField(exist=false)
    private Boolean sendMessage;
    /**是否发送短信通知*/
    @TableField(exist=false)
    private Boolean sendSms;
    /**是否发送邮件通知*/
    @TableField(exist=false)
    private Boolean sendEmail;
    /**流程设置参数*/
    @JsonIgnore
    @TableField(exist=false)
    private Map<String, Object> params = new HashMap<>(16);


}
